import { defineStore } from 'pinia';
import {ref} from 'vue'
export const useMyStore = defineStore('shenling', () => {
	const count = ref(0);
  const token = ref('')
  const user = ref({})

	function increment() {
		count.value++;
	}
  function setToken(val){
    token.value = val
  }
  function setLoginUser(val){
    user.value = val
  }

	return { count, increment,token,setToken,setLoginUser,user };
},{
	persist: {
		storage: {
			getItem: uni.getStorageSync,
			setItem: uni.setStorageSync
		}
	}
});
